<include file="public@header" />
<style>
	.controls{ color:#999}
	.minwidth{width:45px !important}
	div[name='d_gaiban'],div[name='d_al']{ width:100%;float:left;}
	.form-horizontal .control-group1{}
</style>
</head>
<body>
	<php>$type=''</php>
	<div class="wrap">
		<ul class="nav nav-tabs">
        	<li><a href="{:url('cemetery/index')}">{:lang('ADMIN_CEMETERY_INDEX')}</a></li>
			<li><a href="{:url('cemetery/add')}">{:lang('ADMIN_CEMETERY_ADD')}</a></li>
			<li><a href="{:url('tombarea/index',array('parentid'=>$parent_id,'id'=>$ceme_id))}">{:lang('ADMIN_TOMBAREA_INDEX')}</a></li>
			<li><a href="{:url('tombarea/add')}">{:lang('ADMIN_TOMBAREA_ADD')}</a></li>
			<li class="active"><a href="{:url('tombarea/product')}">{:lang('ADMIN_TOMBAREA_PRODUCT')}</a></li>
		</ul>
		<form method="post" class="form-horizontal js-ajax-form" action="{:url('Tombarea/productadd_post')}" style="width:87%; float:left">
			<fieldset>
                <input type="hidden" class="form-control" name="tombar_id" value="{$tombar_id}" >
                <input type="hidden" class="form-control" name="id" value="{$id}" >
	            <!--商品葬-->
                <div class="p_title">
                	<span class="span_title">基础信息</span>
                </div>
                <div class="control-group1-p">
                    <div class="control-group1" >
                        <label class="control-label">状态:</label>
                        <div class="controls">
                            <select class="form-control" name="pro_status">
                                <if condition="$pro_status eq 1">
                                    <option value="1" selected>启用</option>
                                    <option value="2" >关闭</option>
                                    <option value="3" >停产</option>
                                <elseif condition="$pro_status eq 2" />
                                    <option value="1" >启用</option>
                                    <option value="2" selected>关闭</option>
                                    <option value="3" >停产</option>
                                <else />
                                    <option value="1" >启用</option>
                                    <option value="2" >关闭</option>
                                    <option value="3" selected>停产</option>
                                </if>
                            </select>
                        </div>
                    </div>
                    <div class="control-group1">
                        <label class="control-label">占地规格:</label>
                        <div class="controls">
                           <input type="text" class="form-control" name="footprint" value="{$footprint}">
                        </div>
                    </div>
                    <div class="control-group1">
                        <label class="control-label">墓碑总高:</label>
                        <div class="controls">
                           <input type="text" class="form-control" name="tombstone_h" value="{$tombstone_h}" >
                        </div>
                    </div>
                    <div class="control-group1">
                        <label class="control-label">墓穴规制:</label>
                        <div class="controls">
                            <select class="form-control" name="tomb_regulation">
                                <if condition="$tomb_regulation eq 1">
                                    <option value="1" selected>单</option>
                                    <option value="2">双</option>
                                    <option value="3">三</option>
                                <elseif condition="$tomb_regulation eq 2" />
                                    <option value="1">单</option>
                                    <option value="2" selected>双</option>
                                    <option value="3">三</option>
                                <else />
                                    <option value="1">单</option>
                                    <option value="2">双</option>
                                    <option value="3" selected>三</option>
                                </if>
                            </select>
                        </div>
                    </div>
                    <div class="control-group1">
                        <label class="control-label">质保期:</label>
                        <div class="controls">
                            <select class="form-control" name="warranty" >
                                <if condition="$warranty eq 1">
                                    <option value="1" selected>购买起计五年</option>
                                    <option value="2">购买起计二十年</option>
                                <else />
                                    <option value="1">购买起计五年</option>
                                    <option value="2" selected>购买起计二十年</option>
                                </if>
                            </select>
                        </div>
                    </div>
                    <div class="control-group1">
                        <label class="control-label">拜道规格:</label>
                        <div class="controls">
                            <input type="text" class="form-control" name="specifications" value="{$specifications}">
                        </div>
                    </div>
                    <div class="control-group1">
                        <label class="control-label">绿化带规格:</label>
                        <div class="controls">
                            <input type="text" class="form-control" name="green_belt" value="{$green_belt}">
                        </div>
                    </div>
                    <div class="control-group1">
                        <label class="control-label">销售价格:</label>
                        <div class="controls">
                            <input type="text" class="form-control" name="selling_price" value="{$selling_price}">
                        </div>
                    </div>
                    <div class="control-group1">
                        <label class="control-label">管理周期:</label>
                        <div class="controls">
                            <select class="form-control" name="manage_cycle">
                                <if condition="$manage_cycle eq 1">
                                    <option value="1" selected>购买起计二十年</option>
                                    <option value="2">购买起计五年</option>
                                <else />
                                    <option value="1">购买起计二十年</option>
                                    <option value="2" selected>购买起计五年</option>
                                </if>
                            </select>
                        </div>
                    </div>
                    <div class="control-group1">
                        <label class="control-label">供应商:</label>
                        <div class="controls">
                            <input type="text" class="form-control" name="supplier" value="{$supplier}">
                        </div>
                    </div>
                    <div class="control-group1">
                        <label class="control-label">以旧换新产品:</label>
                        <div class="controls">
                            <input type="text" class="form-control" name="change_name" disabled>
                            <input type="hidden" class="form-control" name="old_pro" value="{$tombstone_h}">
                        </div>
                    </div>
                </div>
                <div class="p_title">
                	<span class="span_title">墓碑信息</span>
                </div>
                <div class="control-group1-p" >
                    <div class="control-group1" style="width:100%">
                        <label class="control-label">款式名称:</label>
                        <div class="controls">
                            <select class="form-control" name="new_pro" id="select_pro_id" onchange="A(this)">
                                <option value=""></option>
                                <volist name="product" id="vo">
                                    <if condition="$new_pro eq $vo.id">
                                        <option value="{$vo.id}" selected>{$vo.name}</option>
                                   <else/>
                                        <option value="{$vo.id}">{$vo.name}</option>
                                    </if>
                                </volist>
                            </select>
                        </div>
                    </div>
                    <div name="proName">  </div>
                    <!--壁葬-->
                    <if condition="$type eq '壁葬'">
                        <div class="control-group1">
                            <label class="control-label">格位长度:</label>
                            <div class="controls">
                               <input type="text" class="form-control" name="name">
                            </div>
                        </div>
                        <div class="control-group1">
                            <label class="control-label">格位纵深:</label>
                            <div class="controls">
                               <input type="text" class="form-control" name="name">
                            </div>
                        </div>
                        <div class="control-group1">
                            <label class="control-label">格位高度:</label>
                            <div class="controls">
                               <input type="text" class="form-control" name="name">
                            </div>
                        </div>
                        <div class="control-group1">
                            <label class="control-label">格位规制:</label>
                            <div class="controls">
                                <select class="form-control" name="menu_type">
                                    <option value="1">单</option>
                                    <option value="2">双</option>
                                </select>
                            </div>
                        </div>
                        <div class="control-group1">
                            <label class="control-label">安葬类型:</label>
                            <div class="controls">
                                <select class="form-control" name="menu_type">
                                    <option value="1">骨灰盒</option>
                                    <option value="2">骨灰坛</option>
                                    <option value="2">特殊容器</option>
                                </select>
                            </div>
                        </div>
                        <div class="control-group1">
                            <label class="control-label">销售价格:</label>
                            <div class="controls">
                               <input type="text" class="form-control" name="name">
                            </div>
                        </div>
                        <div class="control-group1">
                            <label class="control-label">管理周期:</label>
                            <div class="controls">
                               <input type="text" class="form-control" name="name" style=" width:80px"> 年
                            </div>
                        </div>
                        <div class="control-group1">
                            <label class="control-label">可寄存:</label>
                            <div class="controls">
                                <select class="form-control" name="menu_type">
                                    <option value="1">是</option>
                                    <option value="2">否</option>
                                </select>
                            </div>
                        </div>
                    </if>
                    <!--生态葬-->
                    <if condition="$type eq '生态葬'">
                        <div class="control-group1">
                            <label class="control-label">葬区面积:</label>
                            <div class="controls">
                               <input type="text" class="form-control" name="name">
                            </div>
                        </div>
                        <div class="control-group1">
                            <label class="control-label">葬式:</label>
                            <div class="controls">
                                <select class="form-control" name="menu_type">
                                    <option value="1">水葬</option>
                                    <option value="2">土葬</option>
                                    <option value="3">其他葬式</option>
                                </select>
                            </div>
                        </div>
                        <div class="control-group1">
                            <label class="control-label">可容纳骨灰总量:</label>
                            <div class="controls">
                               <input type="text" class="form-control" name="name">
                            </div>
                        </div>
                        <div class="control-group1">
                            <label class="control-label">单次最高安葬量:</label>
                            <div class="controls">
                               <input type="text" class="form-control" name="name">
                            </div>
                        </div>
                        <div class="control-group1">
                            <label class="control-label">不保留骨灰:</label>
                            <div class="controls">
                               <input type="text" class="form-control" name="name">
                            </div>
                        </div>
                        <div class="control-group1">
                            <label class="control-label">安葬器皿:</label>
                            <div class="controls">
                                <select class="form-control" name="menu_type">
                                    <option value="1">降解坛</option>
                                </select>
                            </div>
                        </div>
                    </if>
                    <!--艺术墓-->
                    <if condition="$type eq '艺术葬'">
                        <div class="control-group1">
                            <label class="control-label">占地规格:</label>
                            <div class="controls">
                               <input type="text" class="form-control" name="name">
                            </div>
                        </div>
                        <div class="control-group1">
                            <label class="control-label">套内总长:</label>
                            <div class="controls">
                               <input type="text" class="form-control" name="name" style="width:80px"> M
                            </div>
                        </div>
                        <div class="control-group1">
                            <label class="control-label">套内总宽:</label>
                            <div class="controls">
                               <input type="text" class="form-control" name="name" style="width:80px"> M
                            </div>
                        </div>
                        <div class="control-group1">
                            <label class="control-label">建议使用:</label>
                            <div class="controls">
                               <input type="text" class="form-control" name="name">
                            </div>
                        </div>
                        <div class="control-group1">
                            <label class="control-label">室内是否含拜道:</label>
                            <div class="controls">
                              <select class="form-control" name="menu_type">
                                    <option value="1">是</option>
                                    <option value="2">否</option>
                                </select>
                            </div>
                        </div>
                        <div class="control-group1">
                            <label class="control-label">拜道规格:</label>
                            <div class="controls">
                               <input type="text" class="form-control" name="name">
                            </div>
                        </div>
                        <div class="control-group1">
                            <label class="control-label">总高限制:</label>
                            <div class="controls">
                               <input type="text" class="form-control" name="name">
                            </div>
                        </div>

                        <div class="control-group1">
                            <label class="control-label">销售价格:</label>
                            <div class="controls">
                               <input type="text" class="form-control" name="name" style="width:80px">
                               <select class="form-control" name="menu_type" style="width:120px">
                                    <option value="1">元/平米</option>
                                    <option value="2">元/套</option>
                                </select>
                            </div>
                        </div>
                        <div class="control-group1">
                            <label class="control-label">质保期:</label>
                            <div class="controls">
                               <input type="text" class="form-control" name="name">
                            </div>
                        </div>
                        <div class="control-group1">
                            <label class="control-label">管理周期:</label>
                            <div class="controls">
                                <select class="form-control" name="menu_type">
                                    <option value="1">20年</option>
                                    <option value="2">50年</option>
                                    <option value="3">70年</option>
                                </select>
                            </div>
                        </div>
                        <div class="control-group1">
                            <label class="control-label">签约套数:</label>
                            <div class="controls">
                               <input type="text" class="form-control" name="name" style="width:80px"> 套
                            </div>
                        </div>
                        <div class="control-group1">
                            <label class="control-label">设计方案:</label>
                            <div class="controls">
                                <input type="text" class="form-control" name="icon" id="action">
                                <a href="http://www.thinkcmf.com/font/icons" target="_blank">选择图片</a>
                            </div>
                        </div>
                    </if>
                </div>
			</fieldset>
			<div class="form-actions">
				<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
				<a class="btn btn-default" href="javascript:history.back(-1);">{:lang('BACK')}</a>
			</div>            
		</form>
        <div style="width:13%; float:left">
            <img src="__TMPL__/Public/assets/images/1.png" class="preview" style="max-width:200px; display:block; margin:0 auto;"/>
        </div>
	</div>
    <script type="text/javascript" src="__STATIC__/js/admin.js?v={:time()}"></script>
	<script>
        $("#select_pro_id").trigger("onchange")
        function A(obj){
            var id = obj.value;
            console.log(id)
            $.ajax({
                url		: "{:url('tombarea/getProductInfo')}",
                type	: "post",
                dataType: "json",
                data	: {'id':id,'Ajax': 1},
                success : function(result){
                    var html = getCommonHtml(result);
                    $("div[name='proName']").html(html);
                },
                error	: function(){
                    alert("服务器内部错误，请联系系统管理员");
                }
            });

        }
		$(document).ready(function(){
		    var cate_type = {$cate_type};
            getOptionHtml = function(icate){
                var html = "";
                $.each(cate_type, function(i, n){
                    if(n.id == icate) {
                        html += "<option value='"+n.id+"' selected>"+n.name+"</option>";
                    }else{
                        html += "<option value='"+n.id+"'>"+n.name+"</option>";
                    }
                })
                return html;
            }
            var json = {$annexJson};
            getAnnexHtml = function(annex){
                var html = "";
                $.each(json, function(i, n){
                    if(n.id == annex) {
                        html += "<option value='"+n.id+"' selected>"+n.name+"</option>";
                    }else{
                        html += "<option value='"+n.id+"'>"+n.name+"</option>";
                    }
                })
                return html;
            }
            getCommonHtml = function(result){
                if(result.infoData.length == 0){
                    $("div[name='proName']").html('');
                    $("input[name='change_name']").val("");
                    $("input[name='old_pro']").val(0);
                    return;
                }
                var change_name = result.data.name;
                if(change_name == null || change_name == ''){
                    change_name = "无";
                }
                $("input[name='change_name']").val(change_name);
                $("input[name='old_pro']").val(result.data.change_id);
                var html="";
                $.each(result.infoData, function(i, n){
                    html +="<div class='control-group1'>"
                        +"<label class='control-label'>"+n.iname+":</label>"
                        +"<div class='controls'>"
                        +"<input type='text' class='form-control minwidth' placeholder='宽' value='"+n.iwidth+"' disabled>"
                        +"<input type='text' class='form-control minwidth' placeholder='高' value='"+n.iheight+"' disabled>"
                        +"<input type='text' class='form-control minwidth' placeholder='厚' value='"+n.ithick+"' disabled> mm"
                        +"</div>"
                        +"</div>"
                        +"<div class='control-group1'>"
                        +"<label class='control-label'>石材种类:</label>"
                        +"<div class='controls'>"
                        +"<select class='form-control' disabled>";
                    html+=getOptionHtml(n.icate);
                    html+="</select>"
                        +"</div>"
                        +"</div>"
                        +"<div class='control-group1' style='width:16%'>"
                        +"<label class='control-label'>数量:</label>"
                        +"<div class='controls'>"
                        +"<input type='text' class='form-control' style='width:100px;' value='"+n.inumber+"' disabled>"
                        +"</div>"
                        +"</div>"
                        +"<div class='control-group1' style='width:16%'>"
                        +"<label class='control-label'>维修价格:</label>"
                        +"<div class='controls'>"
                        +"<input type='text' class='form-control' style='width:100px;' value='"+n.irepair_price+"' disabled>"
                        +"</div>"
                        +"</div>"
                        +"<div class='control-group1'  style='width:16%'>"
                        +"<label class='control-label'>更换价格:</label>"
                        +"<div class='controls'>"
                        +"<input type='text' class='form-control' style='width:100px;' value='"+n.ichange_price+"' disabled>"
                        +"</div>"
                        +"</div>";
                });
                html+="<div class='control-group1' style='width:100%'>"
                    +"<label class='control-label'>基础:</label>"
                    +"<div class='controls'>"
                    +"<select class='form-control' id='select_jichu' disabled>";
                if(result.data.pro_base == 1){
                    html+="<option value='1'>整石</option>";
                }else{
                    html+="<option value='2'>贴面</option>";
                }
                html+="</select>"
                    +"</div>"
                    +"</div>";
                // 基础
                $.each(result.baseData, function(i, n){
                    if(result.data.pro_base == 1 && i>5){
                        return true
                    }
                    if(result.data.pro_base == 2 && i<6){
                        return true
                    }
                    html+="<div class='control-group1'>"
                        +"<label class='control-label'>"+n.iname+":</label>"
                        +"<div class='controls'>"
                        +"<input type='text' class='form-control minwidth' placeholder='宽'  value='"+n.iwidth+"' disabled>"
                        +"<input type='text' class='form-control minwidth' placeholder='高'  value='"+n.iheight+"' disabled>"
                        +"<input type='text' class='form-control minwidth'  placeholder='厚'  value='"+n.ithick+"' disabled> mm"
                        +"</div>"
                        +"</div>"
                        +"<div class='control-group1'>"
                        +"<label class='control-label'>石材种类:</label>"
                        +"<div class='controls'>"
                        +"<select class='form-control'  disabled>";
                    html+=getOptionHtml(n.icate);
                    html+="</select>"
                        +"</div>"
                        +"</div>"
                        +"<div class='control-group1' style='width:16%' >"
                        +"<label class='control-label'>数量:</label>"
                        +"<div class='controls'>"
                        +"<input type='text' class='form-control'  style='width:100px;' value='"+n.inumber+"' disabled>"
                        +"</div>"
                        +"</div>"
                        +"<div class='control-group1' style='width:16%' >"
                        +"<label class='control-label'>维修价格:</label>"
                        +"<div class='controls'>"
                        +"<input type='text' class='form-control'style='width:100px;' value='"+n.irepair_price+"' disabled>"
                        +"</div>"
                        +"</div>"
                        +"<div class='control-group1'  style='width:16%' >"
                        +"<label class='control-label'>更换价格:</label>"
                        +"<div class='controls'>"
                        +"<input type='text' class='form-control' style='width:100px;' value='"+n.ichange_price+"' disabled>"
                        +"</div>"
                        +"</div>";
                })
                // 盖板
                $.each(result.plateData, function(i, n){
                    html+="<div class='control-group1'>"
                        +"<label class='control-label'>"+n.iname+":</label>"
                        +"<div class='controls'>"
                        +"<input type='text' class='form-control minwidth' placeholder='宽'  value='"+n.iwidth+"' disabled>"
                        +"<input type='text' class='form-control minwidth' placeholder='高'  value='"+n.iheight+"' disabled>"
                        +"<input type='text' class='form-control minwidth' placeholder='厚'  value='"+n.ithick+"' disabled> mm"
                        +"</div>"
                        +"</div>"
                        +"<div class='control-group1'>"
                        +"<label class='control-label'>石材种类:</label>"
                        +"<div class='controls'>"
                        +"<select class='form-control' disabled>";
                    html+=getOptionHtml(n.icate);
                    html+="</select>"
                        +"</div>"
                        +"</div>"
                        +"<div class='control-group1' style='width:16%'>"
                        +"<label class='control-label'>数量:</label>"
                        +"<div class='controls'>"
                        +"<input type='text' class='form-control' style='width:100px;' value='"+n.inumber+"' disabled>"
                        +"</div>"
                        +"</div>"
                        +"<div class='control-group1' style='width:16%' >"
                        +"<label class='control-label'>维修价格:</label>"
                        +"<div class='controls'>"
                        +"<input type='text' class='form-control' style='width:100px;' value='"+n.irepair_price+"' disabled>"
                        +"</div>"
                        +"</div>"
                        +"<div class='control-group1'  style='width:14%'>"
                        +"<label class='control-label'>更换价格:</label>"
                        +"<div class='controls'>"
                        +"<input type='text' class='form-control' style='width:85px;' value='"+n.ichange_price+"' disabled>"
                        +"</div>"
                        +"</div>"
                })
                html+="<div class='control-group1' style='width:100%'>"
                    +"<label class='control-label'>有无栏杆:</label>"
                    +"<div class='controls'>"
                    +"<select class='form-control' disabled>";
                if(result.data.pro_railing == 1){
                    html+="<option value='1'>有</option>";
                }else{
                    html+="<option value='2'>无</option>";
                }
                html+="</select>"
                    +"</div>"
                    +"</div>";
                // 栏杆
                $.each(result.railData, function(i, n){
                    html+="<div class='control-group1'>"
                        +"<label class='control-label'>"+n.iname+":</label>"
                        +"<div class='controls'>"
                        +"<input type='text' class='form-control minwidth' placeholder='宽' value='"+n.iwidth+"' disabled>"
                        +"<input type='text' class='form-control minwidth' placeholder='高'  value='"+n.iheight+"' disabled>"
                        +"<input type='text' class='form-control minwidth' placeholder='厚' value='"+n.ithick+"' disabled> mm"
                        +"</div>"
                        +"</div>"
                        +"<div class='control-group1'>"
                        +"<label class='control-label'>石材种类:</label>"
                        +"<div class='controls'>"
                        +"<select class='form-control' disabled>";
                    html+=getOptionHtml(n.icate);
                    html+="</select>"
                        +"</div>"
                        +"</div>"
                        +"<div class='control-group1' style='width:16%'>"
                        +"<label class='control-label'>数量:</label>"
                        +"<div class='controls'>"
                        +"<input type='text' class='form-control' style='width:100px;'  value='"+n.inumber+"' disabled>"
                        +"</div>"
                        +"</div>"
                        +"<div class='control-group1' style='width:16%' >"
                        +"<label class='control-label'>维修价格:</label>"
                        +"<div class='controls'>"
                        +"<input type='text' class='form-control' style='width:100px;' value='"+n.irepair_price+"' disabled>"
                        +"</div>"
                        +"</div>"
                        +"<div class='control-group1'  style='width:16%'>"
                        +"<label class='control-label'>更换价格:</label>"
                        +"<div class='controls'>"
                        +"<input type='text' class='form-control' style='width:100px;' value='"+n.ichange_price+"' disabled>"
                        +"</div>"
                        +"</div>";
                })
                // 附件
                html+="<div class='control-group1' style='width:100%'>"
                    +"<label class='control-label'>有无附件:</label>"
                    +"<div class='controls'>"
                    +"<select class='form-control' disabled>";
                if(result.data.pro_annex == 1){
                    html+="<option value='1'>有</option>";
                }else{
                    html+="<option value='2'>无</option>";
                }
                html+="</select>"
                    +"</div>"
                    +"</div>";
                $.each(result.annexData, function(i, n){
                    html+="<div class='control-group1'>"
                        +"<label class='control-label'>选择附件:</label>"
                        +"<div class='controls'>"
                        +"<select class='form-control' disabled>";
                    html+=getAnnexHtml(n.annex_id);
                    html+="</select>"
                        +"</div>"
                        +"</div>"
                        +"<div class='control-group1' style='width:75%'>"
                        +"<label class='control-label'>数量:</label>"
                        +"<div class='controls'>"
                        +"<input type='text' class='form-control' value='"+n.anumber+"' disabled>"
                        +"</div>"
                        +"</div>";

                })
                return html;
            }

			$("#select_langan").change(function(){
				if($(this).val()==2){
					$("div[name='langan']").hide();
				}else{
					$("div[name='langan']").show();
				}
			});
			$("#select_fujian").change(function(){
				if($(this).val()==2){
					$("div[name='fujian']").hide();
				}else{
					$("div[name='fujian']").show();
				}
			});
			$("#select_jichu").change(function(){
				if($(this).val()==2){
					$("div[name='tiemian']").show();
					$("div[name='zhengshi']").hide();
				}else{
					$("div[name='tiemian']").hide();
					$("div[name='zhengshi']").show();
				}
			});
			$(document).on('click','#del_fujian',function(){
				$(this).parents("div[name='d_al']").remove();
			});
			$(document).on('click','#del_gaiban',function(){
				$(this).parents("div[name='d_gaiban']").remove();
			});
			$("#add_fujian").click(function(){
				var str = "";
				str = "<div name='d_al'><div class='control-group1' name='fujian'>" +
							"<label class='control-label'>选择附件:</label>" +
							"<div class='controls'>" +
								"<select class='form-control' name='menu_type'>" +
									"<option value='1'>附件名称</option>" +
								"</select>" +
							"</div>" +
						"</div>" +
						"<div class='control-group1' name='fujian'>" +
							"<label class='control-label'>数量:</label>" +
							"<div class='controls'>" +
							   "<input type='text' class='form-control' name='name' >" +
							"</div>" +
						"</div>" +
						"<div class='control-group1' name='fujian' style='width:50%'>" +
							"<div class='btn btn-primary' id='del_fujian'>删除附件</div>" +
						"</div></div>"
				
				$(this).parent("div").after(str);
			})
			//添加改版
			$("#add_gaiban").click(function(){
				var str = "";
				str = "<div name='d_gaiban'><div class='control-group1'>"+
					"<label class='control-label'>盖板:</label>"+
					"<div class='controls'>"+
                       "<input type='text' name='name' placeholder='宽' class='minwidth form-control'>"+
                       "<input type='text' name='name' placeholder='高' class='minwidth form-control'>"+
                       "<input type='text' name='name' placeholder='厚' class='minwidth form-control'> mm"+
					"</div>"+
				"</div>"+
                "<div class='control-group1'>"+
					"<label class='control-label'>石材种类:</label>"+
					"<div class='controls'>"+
						"<select class='form-control' name='menu_type'>"+
							"<option value='1'>花岗岩 - G654</option>"+
							"<option value='2'>花岗岩 - 山西黑</option>"+
                            "<option value='3'>花岗岩 - 樱花红</option>"+
						"</select>"+
					"</div>"+
				"</div>"+
				"<div class='control-group1' style='width:16%'>"+
					"<label class='control-label'>数量:</label>"+
					"<div class='controls'>"+
                       "<input type='text' class='form-control' name='name' style='width:100px;'>"+
					"</div>"+
				"</div>"+
                "<div class='control-group1' style='width:16%' >"+
					"<label class='control-label'>维修价格:</label>"+
					"<div class='controls'>"+
                      " <input type='text' class='form-control' name='name' style='width:100px;'>"+
					"</div>"+
				"</div>"+
                "<div class='control-group1'  style='width:16%'>"+
					"<label class='control-label'>更换价格:</label>"+
					"<div class='controls'>"+
                       "<input type='text' class='form-control' name='name' style='width:100px;'>"+
					"</div>"+
				"</div>"+
				"<div class='control-group' name='fujian' style='width:16%'>" +
					"<div class='btn btn-primary' id='del_gaiban'>删除盖板</div>" +
				"</div></div>"
				
				$(this).parent("div").after(str);
			})
		})
	</script>